package be.jabapage.snooker.service.competition.api;

import java.util.Set;

import be.jabapage.snooker.exception.EntityNotFoundException;
import be.jabapage.snooker.jdo.competition.CompetitionGamePlayer;

/**
 * 
 * CRUD service for the CompetitionGamePlayerGame
 * @author axesq
 *
 */
public interface ICompetitionGamePlayerService {

	/**
	 * 
	 * Store or update a CompetitionGamePlayer in the data store
	 * @param CompetitionGamePlayer
	 */
	void store(CompetitionGamePlayer competitionGamePlayer);

	/**
	 * Retrieve a CompetitionGamePlayer by the key
	 * @param key
	 * @return CompetitionGamePlayer
	 * @throws EntityNotFoundException when no record is found
	 */
	CompetitionGamePlayer retrieve(Long key) throws EntityNotFoundException;

	/**
	 * Delete the instance with this key from the datastore.
	 * @param key
	 * @throws EntityNotFoundException when the instance is not found;
	 */
	void delete(Long key) throws EntityNotFoundException;

	/**
	 * 
	 * Retrieve all the games for one single competitionGame.
	 * @param competitionGameId the id of the record in CompetitionGame
	 * @return Set of all the games that belongs to this team.  Home or Away
	 */
	Set<CompetitionGamePlayer> retrieveForCompetitionGame(Long competionGameId);

}
